package com.xiaobias.a09;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;

/*
    如果 jdk > 8, 运行时请添加 --add-opens java.base/java.lang=ALL-UNNAMED
 */
@ComponentScan("com.xiaobias.a09")
public class A09Application {
     private static final Logger logger = LoggerFactory.getLogger(A09Application.class);

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(A09Application.class);

        E e = context.getBean(E.class);
        logger.debug("{}", e.getF1().getClass());
        logger.debug("{}", e.getF1());
        logger.debug("{}", e.getF1());

        logger.debug("{}", e.getF2().getClass());
        logger.debug("{}", e.getF2());
        logger.debug("{}", e.getF2());

        logger.debug("{}", e.getF3().getClass());
        logger.debug("{}", e.getF3());
        logger.debug("{}", e.getF3());

        logger.debug("{}", e.getF4().getClass());
        logger.debug("{}", e.getF4());
        logger.debug("{}", e.getF4());


        context.close();
    }
}
